package com.balisong.y.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author balisong_fcs
 * @date 2020/12/19 17:27
 */
@Configuration
public class RestHighLevelClientConfig {
    @Bean("client")
    public RestHighLevelClient getClient() {
        return new RestHighLevelClient(RestClient.builder(new HttpHost("192.168.200.150", 9200, "http")));
    }
}
